package com.nantian.logic.controller.mainControl.universityControl;


import com.cuit.springboot.gdao.university.UniversityMapper;
import com.cuit.springboot.gentry.university.University;
import com.nantian.logic.utils.UniversalResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value="/university")
public class UniverityController {

    @Autowired UniversityMapper uniMapper;

    @PostMapping(value="/selAllByCity")
    public UniversalResult<List<University>> selAllByCity(@RequestBody University uni){
        List<University> list=uniMapper.selectByUniversityid(uni.getProid());
        return new UniversalResult<>(UniversalResult.SUCCESS,"ok",list);
    }

    @PostMapping(value = "/selectAll")
    public UniversalResult select() {

        return new UniversalResult<>(UniversalResult.SUCCESS, "查询成功", uniMapper.selectAll());
    }


}
